<?php

namespace common\models\Plug;

use Yii;

/**
 * This is the model class for table "plug".
 *
 * @property string $id
 * @property string $name
 * @property string $url
 * @property string $area
 * @property int $start_delayed
 * @property int $valid_time
 * @property int $auto_close 0不启用 0启用
 * @property string $mutex_id
 * @property string $created_time
 * @property string $updated_time
 * @property int $status
 * @property string $md5
 */
class PlugBase extends \common\models\CommonModel\CommonModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'plug';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['url'], 'required'],
            [['area'], 'string'],
            [['start_delayed', 'valid_time', 'auto_close', 'mutex_id', 'status'], 'integer'],
            [['created_time', 'updated_time'], 'safe'],
            [['name'], 'string', 'max' => 50],
            [['url'], 'string', 'max' => 255],
            [['md5'], 'string', 'max' => 32],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'url' => 'Url',
            'area' => 'Area',
            'start_delayed' => 'Start Delayed',
            'valid_time' => 'Valid Time',
            'auto_close' => 'Auto Close',
            'mutex_id' => 'Mutex ID',
            'created_time' => 'Created Time',
            'updated_time' => 'Updated Time',
            'status' => 'Status',
            'md5' => 'Md5',
        ];
    }
}
